package indigo.sound 
{
	
	
	
	
	
	
	
	
	/**
	 * The loadAndPlaySound function is used as a shortcut to load, play and add sounds to the SoundController
	 * @param	String that indicates the filename of the sound file
	 * @param	Number that indicates the volume of the loaded sound file
	 * @param	Number that indicates the pan of the loaded sound file
	 * @return	Reference to the SoundController instance
	 * 
	 */
	public function loadAndPlaySound( filename:String, volume:Number = 1.0, pan:Number = 0.0 ):SingleSound 
	{
		// Create SoundController
		var mySound:SingleSound = new SingleSound;
		mySound.loadSound( filename, null ); 
		mySound.autoClose = true;
		mySound.play( volume, pan );
		
		return mySound;		
	}
}
